#coding:utf-8

# POWER_TABLE_DICT = {
#     'phone':    400,
#     'tablet':   950,
#     's820':     [[1.05,69,115],130,260,450,640,850,980,1430,1890,2430,3050],      # S820 kryo HP single x 1.3
#     's821':     [[1.05,0,250],180,220,310,480,750,1040,1370,1900,2380,2980],     # S821 kryo HP single x 2, big is the same as LITTLE credit by 叶落情殇 in coolapk
#     '7420a57':  [[1.0,0,280],150,240,350,480,630,880,1170,1490,1950,2600],      # anandtech 7420 A57 x 2
#     '7420a53':  [[0.8,0,270],50,70,130,210,330,490,710,1000,1350,1820],         # anandtech 7420 A53 X3 INSERT VALUE
#     '950a72':   [[1.1,0,300],150,260,380,500,650,850,1120,1300,1650,2100],     # Kirin 950 A72 X2 https://www.anandtech.com/show/9878/the-huawei-mate-8-review/3
#     's810a57':  [[1.0,0,250],150,290,440,630,890,1180,1580,2170,3130,4900],     # S810 A57 x 2 https://www.anandtech.com/show/8933/snapdragon-810-performance-preview/4  http://tieba.baidu.com/p/4244007169?see_lz=1
#     's810a53':  [[0.8,0,225],100,110,130,230,390,630,1010,1600,1800,1800],       # S810 A53 x 3 the same as above 1.8g-2.0g does not exist
#     's801':     [[0.7,0,320],240,350,520,700,960,1180,1450,1800,2150,2550],     # S800 krait 400 pvs4 single x 2.5
#     'denverk1': [[1.0,69,110],550,950,1300,1850,2550,3150,4350,4550,5550,6250],  # nexus9 x 2 100%
#     's835a73':  [[1.15,0,320],170,230,360,490,620,730,880,1090,1380,1750],      # S835 A73 x 2 MI6 credit by 叶落情殇 in coolapk
#     's835a53':  [[0.8,0,400],160,200,310,410,500,570,650,770,870,1000]          # S835 A53 x 3 MI6 credit by 叶落情殇 in coolapk
# }

POWER_TABLE_DICT = {
    # galaxy S9 on-screen idle: 430mw
    'phone':    400,
    'tablet':   950,
    'idle':     10,
    's650_l':{
        # generated by generic-180320.xlsx
        'relative_ipc': 0.80,
        'min_freq': 4,
        'max_freq': 14,
        'enough_capacity': 1400,
        # it tells you the next hop
        'freq_table': [4, 4, 4, 4, 7, 7, 7, 8, 10, 10, 12, 12, 13, 14, 14, 14, 14, 14, 14, 14],
        'power_table': [ 74, 74, 74, 83, 106, 142, 187, 241, 303, 374, 
                        454, 545, 651, 775, 920, 1092, 1297, 1541, 1833, 2179],
    },
    's650_b':{
        # generated by generic-180320.xlsx
        'relative_ipc': 1.10,
        'min_freq': 4,
        'max_freq': 18,
        'enough_capacity': 1600,
        # it tells you the next hop
        'freq_table': [4, 4, 4, 4, 9, 9, 9, 9, 9, 10, 11, 12, 13, 14, 16, 16, 17, 18, 18, 18],
        'power_table': [ 148, 148, 148, 161, 198, 254, 326, 412, 511, 623, 
                        747, 886, 1042, 1219, 1421, 1653, 1920, 2232, 2594, 3017]
    },
    's821_l':{
        # generated by generic-180320.xlsx
        'relative_ipc': 1.05,
        'min_freq': 3,
        'max_freq': 16,
        'enough_capacity': 1300,
        # it tells you the next hop
        'freq_table': [3, 3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 16, 16, 16],
        'power_table': [ 164, 164, 164, 181, 227, 297, 386, 493, 616, 754, 
                        910, 1086, 1286, 1516, 1782, 2092, 2455, 2882, 3386, 3979],
    },
    's821_b':{
        # generated by generic-180320.xlsx
        'relative_ipc': 1.05,
        'min_freq': 3,
        'max_freq': 20,
        'enough_capacity': 1600,
        # it tells you the next hop
        'freq_table': [3, 3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
        'power_table': [ 164, 164, 164, 177, 214, 270, 342, 428, 528, 639, 
                        763, 901, 1054, 1225, 1418, 1636, 1886, 2172, 2502, 2882],
    },
    'k950_b':{
        # generated by generic-180320.xlsx
        'relative_ipc': 1.10,
        'min_freq': 8,
        'max_freq': 20,
        'enough_capacity': 1600,
        # it tells you the next hop
        'freq_table': [8, 8, 8, 8, 8, 8, 8, 8, 12, 12, 12, 12, 15, 15, 15, 18, 18, 18, 20, 20],
        'power_table': [ 115, 115, 115, 125, 154, 198, 254, 321, 398, 484, 
                        581, 689, 811, 948, 1105, 1285, 1494, 1736, 2018, 2347]
    },
    'k950_l':{
        # generated by generic-180320.xlsx
        'relative_ipc': 0.80,
        'min_freq': 5,
        'max_freq': 18,
        'enough_capacity': 1700,
        # it tells you the next hop
        'freq_table': [5, 5, 5, 5, 5, 8, 8, 8, 10, 10, 13, 13, 13, 15, 15, 18, 18, 18, 18, 18],
        'power_table': [ 57, 57, 57, 63, 80, 104, 135, 173, 216, 264, 
                        319, 380, 450, 531, 624, 732, 859, 1009, 1185, 1393],
    },    
    'k960_b':{
        # generated by generic-180320.xlsx
        'relative_ipc': 1.15,
        'min_freq': 9,
        'max_freq': 20,
        'enough_capacity': 1600,
        # it tells you the next hop
        'freq_table': [9, 9, 9, 9, 9, 9, 9, 9, 9, 14, 14, 14, 14, 14, 18, 18, 18, 18, 20, 20],
        'power_table': [ 115, 115, 115, 125, 154, 198, 254, 321, 398, 484, 
                        581, 689, 811, 948, 1105, 1285, 1494, 1736, 2018, 2347]
    },
    'k960_l':{
        # generated by generic-180320.xlsx
        'relative_ipc': 0.80,
        'min_freq': 5,
        'max_freq': 18,
        'enough_capacity': 1700,
        # it tells you the next hop
        'freq_table': [5, 5, 5, 5, 5, 10, 10, 10, 10, 10, 14, 14, 14, 14, 17, 17, 17, 18, 18, 18],
        'power_table': [ 57, 57, 57, 63, 80, 104, 135, 173, 216, 264, 
                        319, 380, 450, 531, 624, 732, 859, 1009, 1185, 1393],
    },
    'k970_b':{
        # generated by generic-180320.xlsx
        'relative_ipc': 1.15,
        'min_freq': 7,
        'max_freq': 20,
        'enough_capacity': 1600,
        # it tells you the next hop
        'freq_table': [7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 12, 12, 13, 15, 15, 16, 18, 18, 20, 20],
        'power_table': [ 98, 98, 98, 106, 128, 162, 205, 257, 317, 383, 
                        458, 540, 632, 735, 851, 982, 1131, 1303, 1501, 1729]
    },
    'k970_l':{
        # generated by generic-180320.xlsx
        'relative_ipc': 0.80,
        'min_freq': 5,
        'max_freq': 18,
        'enough_capacity': 1700,
        # it tells you the next hop
        'freq_table': [5, 5, 5, 5, 5, 10, 10, 10, 10, 10, 12, 12, 14, 14, 15, 17, 17, 18, 18, 18],
        'power_table': [ 49, 49, 49, 54, 66, 85, 109, 137, 170, 208, 
                        249, 295, 347, 406, 474, 551, 640, 744, 865, 1006],
    },
    's625_uni':{
        # generated by generic-180320.xlsx
        'relative_ipc': 0.80,
        'min_freq': 6,
        'max_freq': 20,
        'enough_capacity': 1700,
        # it tells you the next hop
        'freq_table': [6, 6, 6, 6, 6, 6, 10, 10, 10, 10, 14, 14, 14, 14, 17, 17, 17, 18, 19, 20],
        'power_table': [ 57, 57, 57, 63, 80, 104, 135, 173, 216, 264, 
                        319, 380, 450, 531, 624, 732, 859, 1009, 1185, 1393],
    },
    's835_l':{
        # generated by generic-180320.xlsx
        'relative_ipc': 0.80,
        'min_freq': 3,
        'max_freq': 19,
        'enough_capacity': 1700,
        # it tells you the next hop
        'freq_table': [3, 3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 19],
        'power_table': [ 49, 49, 49, 54, 66, 85, 109, 137, 170, 208, 
                        249, 295, 347, 406, 474, 551, 640, 744, 865, 1006],
    },
    's835_b':{
        # generated by generic-180320.xlsx
        'relative_ipc': 1.15,
        'min_freq': 3,
        'max_freq': 20,
        'enough_capacity': 1600,
        # it tells you the next hop
        'freq_table': [3, 3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
        'power_table': [ 98, 98, 98, 106, 128, 162, 205, 257, 317, 383, 
                        458, 540, 632, 735, 851, 982, 1131, 1303, 1501, 1729]
    },
    's660_l':{
        # generated by generic-180320.xlsx
        'relative_ipc': 0.80,
        'min_freq': 6,
        'max_freq': 18,
        'enough_capacity': 1500,
        # it tells you the next hop
        'freq_table': [6, 6, 6, 6, 6, 6, 9, 9, 9, 11, 11, 14, 14, 14, 15, 17, 17, 18, 18, 18],
        'power_table': [ 57, 57, 57, 63, 80, 104, 135, 173, 216, 264, 
                        319, 380, 450, 531, 624, 732, 859, 1009, 1185, 1393],
    },
    's660_b':{
        # generated by generic-180320.xlsx
        'relative_ipc': 1.15,
        'min_freq': 11,
        'max_freq': 20,
        'enough_capacity': 1600,
        # it tells you the next hop
        'freq_table': [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 14, 14, 14, 17, 17, 17, 19, 19, 20],
        'power_table': [ 115, 115, 115, 125, 154, 198, 254, 321, 398, 484, 
                        581, 689, 811, 948, 1105, 1285, 1494, 1736, 2018, 2347]
    },
    's636_l':{
        # generated by generic-180320.xlsx
        'relative_ipc': 0.80,
        'min_freq': 6,
        'max_freq': 16,
        'enough_capacity': 1500,
        # it tells you the next hop
        'freq_table': [6, 6, 6, 6, 6, 6, 9, 9, 9, 11, 11, 14, 14, 14, 15, 16, 16, 16, 16, 16],
        'power_table': [ 57, 57, 57, 63, 80, 104, 135, 173, 216, 264, 
                        319, 380, 450, 531, 624, 732, 859, 1009, 1185, 1393],
    },
    's636_b':{
        # generated by generic-180320.xlsx
        'relative_ipc': 1.15,
        'min_freq': 11,
        'max_freq': 18,
        'enough_capacity': 1600,
        # it tells you the next hop
        'freq_table': [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 14, 14, 14, 17, 17, 17, 18, 18, 18],
        'power_table': [ 115, 115, 115, 125, 154, 198, 254, 321, 398, 484, 
                        581, 689, 811, 948, 1105, 1285, 1494, 1736, 2018, 2347]
    },
    's801_uni':{
        # generated by generic-180320.xlsx
        'relative_ipc': 0.70,
        'min_freq': 3,
        'max_freq': 20,
        'enough_capacity': 1700,
        # it tells you the next hop
        'freq_table': [3, 3, 3, 4, 6, 6, 7, 9, 9, 10, 12, 12, 15, 15, 15, 17, 17, 19, 19, 20],
        # 'power_table': [ 100, 100, 100, 139, 182, 230, 285, 349, 423, 507, 
        #                 604, 714, 839, 980, 1139, 1317, 1515, 1734, 1976, 2242],
        'power_table': [ 148, 148, 148, 157, 184, 225, 279, 343, 417, 500, 
                        592, 693, 804, 926, 1060, 1209, 1376, 1563, 1775, 2014]
    },
    's810_l':{
        # generated by generic-180320.xlsx
        'relative_ipc': 0.80,
        'min_freq': 4,
        'max_freq': 13,
        'enough_capacity': 1200,
        # it tells you the next hop
        'freq_table': [4, 4, 4, 4, 6, 6, 7, 8, 9, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13],
        'power_table': [ 66, 66, 66, 75, 99, 134, 180, 234, 297, 369, 
                        452, 548, 662, 796, 958, 1153, 1389, 1673, 2015, 2426],
    },
    's810_b':{
        # generated by generic-180320.xlsx
        'relative_ipc': 1.00,
        'min_freq': 4,
        'max_freq': 14,
        'enough_capacity': 1300,
        # it tells you the next hop
        'freq_table': [4, 4, 4, 4, 5, 6, 7, 8, 9, 12, 12, 12, 13, 14, 14, 14, 14, 14, 14, 14],
        'power_table': [ 197, 197, 197, 224, 296, 403, 540, 703, 892, 1108, 
                        1356, 1645, 1985, 2389, 2874, 3459, 4166, 5019, 6046, 7277]
    },
    'e8895_l':{
        # generated by generic-180320.xlsx
        'relative_ipc': 0.80,
        'min_freq': 6,
        'max_freq': 17,
        'enough_capacity': 1500,
        # it tells you the next hop
        'freq_table': [6, 6, 6, 6, 6, 6, 7, 8, 9, 10, 12, 12, 14, 14, 17, 17, 17, 17, 17, 17],
        'power_table': [ 49, 49, 49, 54, 66, 85, 109, 137, 170, 208, 
                        249, 295, 347, 406, 474, 551, 640, 744, 865, 1006],
    },
    'e8895_b':{
        # generated by generic-180320.xlsx
        'relative_ipc': 1.15,
        'min_freq': 7,
        'max_freq': 20,
        'enough_capacity': 1600,
        # it tells you the next hop
        'freq_table': [7, 7, 7, 7, 7, 7, 7, 8, 9, 10, 11, 12, 14, 14, 17, 17, 17, 18, 19, 20],
        'power_table': [ 164, 164, 164, 214, 268, 328, 394, 468, 552, 645,
                        750, 866, 997, 1142, 1303, 1480, 1676, 1891, 2125, 2382]
    },
    'e8890_l':{
        # generated by generic-180320.xlsx
        'relative_ipc': 0.80,
        'min_freq': 4,
        'max_freq': 16,
        'enough_capacity': 1500,
        # it tells you the next hop
        'freq_table': [4, 4, 4, 4, 5, 7, 7, 8, 9, 10, 11, 12, 13, 15, 15, 16, 16, 16, 16, 16],
        'power_table': [ 57, 57, 57, 63, 80, 104, 135, 173, 216, 264, 
                        319, 380, 450, 531, 624, 732, 859, 1009, 1185, 1393],
    },
    'e8890_b':{
        # generated by generic-180320.xlsx
        'relative_ipc': 1.10,
        'min_freq': 7,
        'max_freq': 20,
        'enough_capacity': 1600,
        # it tells you the next hop
        'freq_table': [7, 7, 7, 7, 7, 7, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
        'power_table': [ 164, 164, 164, 214, 268, 328, 394, 468, 552, 645,
                        750, 866, 997, 1142, 1303, 1480, 1676, 1891, 2125, 2382]
    },
    'e7420_l':{
        # generated by generic-180320.xlsx
        'relative_ipc': 0.80,
        'min_freq': 4,
        'max_freq': 15,
        'enough_capacity': 1500,
        # it tells you the next hop
        'freq_table': [4, 4, 4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15, 15, 15, 15],
        'power_table': [ 57, 57, 57, 63, 80, 104, 135, 173, 216, 264, 
                        319, 380, 450, 531, 624, 732, 859, 1009, 1185, 1393],
    },
    'e7420_b':{
        # generated by generic-180320.xlsx
        'relative_ipc': 1.00,
        'min_freq': 8,
        'max_freq': 20,
        'enough_capacity': 1600,
        # it tells you the next hop
        'freq_table': [8, 8, 8, 8, 8, 8, 8, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
        'power_table': [ 148, 148, 148, 161, 198, 254, 326, 412, 511, 623, 
                        747, 886, 1042, 1219, 1421, 1653, 1920, 2232, 2594, 3017]
    },
    'z3560_uni':{
        # generated by generic-180320.xlsx
        # X86 mobile processor parameters guessed by me (WTF!)
        'relative_ipc': 0.65,
        'min_freq': 5,
        'max_freq': 18,
        'enough_capacity': 1600,
        # it tells you the next hop
        'freq_table': [5, 5, 5, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
        'power_table': [ 128, 128, 128, 141, 177, 231, 301, 384, 479, 587, 
                        708, 845, 1001, 1179, 1386, 1627, 1909, 2242, 2634, 3095]
    },
    'mt6797_uni':{
        # generated by generic-180320.xlsx
        'relative_ipc': 0.80,
        'min_freq': 3,
        'max_freq': 18,
        'enough_capacity': 1500,
        # it tells you the next hop
        'freq_table': [3, 3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 18, 18],
        'power_table': [ 66, 66, 66, 75, 99, 134, 180, 234, 297, 369, 
                        452, 548, 662, 796, 958, 1153, 1389, 1673, 2015, 2426],
    },
    'mt6795_uni':{
        # generated by generic-180320.xlsx
        'relative_ipc': 0.80,
        'min_freq': 4,
        'max_freq': 19,
        'enough_capacity': 1500,
        # it tells you the next hop
        'freq_table': [4, 4, 4, 4, 8, 8, 8, 8, 12, 12, 12, 12, 13, 15, 15, 16, 19, 19, 19, 19],
        'power_table': [ 66, 66, 66, 75, 99, 134, 180, 234, 297, 369, 
                        452, 548, 662, 796, 958, 1153, 1389, 1673, 2015, 2426],
    },

}

